package orderProcessingProcess.model;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dreni
 */
@XmlRootElement(name="address")
public class Address {

    private String id;
    private String street;
    private String city;
    private int house;
    private int door;
    private String zip_code;


    public Address (String id, String street, String city, int house, int door, String zip_code) {
        
        this.id = id;
        this.street = street;
        this.city = city;
        this.house = house;
        this.door = door;
        this.zip_code = zip_code;
    }

    public Address () {  
    }

    /**
     * @return the id
     */
    @XmlAttribute(name="address_id", required =true)
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the street
     */
    @XmlElement(name="street")
    public String getStreet() {
        return street;
    }

    /**
     * @param street the street to set
     */
    public void setStreet(String street) {
        this.street = street;
    }

    /**
     * @return the city
     */
    @XmlElement(name="city")
    public String getCity() {
        return city;
    }

    /**
     * @param city the city to set
     */
    public void setCity(String city) {
        this.city = city;
    }

    /**
     * @return the hause
     */
    @XmlElement(name="hause")
    public int getHouse() {
        return house;
    }

    /**
     * @param hause the hause to set
     */
    public void setHouse(int house) {
        this.house = house;
    }

    /**
     * @return the door
     */
    @XmlElement(name="door")
    public int getDoor() {
        return door;
    }

    /**
     * @param door the door to set
     */
    public void setDoor(int door) {
        this.door = door;
    }

    /**
     * @return the zip_code
     */
    @XmlElement(name="zip_code")
    public String getZip_code() {
        return zip_code;
    }

    /**
     * @param zip_code the zip_code to set
     */
    public void setZip_code(String zip_code) {
        this.zip_code = zip_code;
    }
    
    
    @Override
    public boolean equals(Object obj) {
    	if(obj.getClass().equals(Address.class))
    	{
    		if(this.id.equals(((Address)obj).getId()))
    			return true;
    	}
        return false;
    }

    @Override
    public int hashCode() {
        return this.id.hashCode();
    }

}
